﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace SHomeWorkshop.LunarSF.StudentInfosManager.Converters
{
    [ValueConversion(typeof(int), typeof(int))]
    public class GradesCountConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return ((int)value) - 1;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return ((int)value) + 1;
        }

        private static GradesCountConverter converter = new GradesCountConverter();

        public static GradesCountConverter Instance
        {
            get { return converter; }
        }
    }
}
